package com.csea.common.domain.dos;

import com.baomidou.mybatisplus.annotation.*;
import com.csea.common.domain.handler.JsonArrayTypeHandler;
import lombok.*;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 用户成语表
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "user_idiom", autoResultMap = true)
public class UserIdiomDo implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    // 主键，自增
    @TableId(type = IdType.AUTO)
    private Integer userIdiomId;

    // 用户ID
    @TableField("user_id")
    private Integer userId;

    // 公共成语ID(无则为NULL)
    @TableField("public_idiom_id")
    private Integer publicIdiomId;

    // 词库ID
    @TableField("repository_id")
    private Integer repositoryId;

    // 成语
    @TableField("word")
    private String word;

    // 释义
    @TableField("meaning")
    private String meaning;

    // 感情色彩，枚举类型
    @TableField("emotional_color")
    private String emotionalColor;

    // 例句，json 类型
    @TableField(value = "examples", typeHandler = JsonArrayTypeHandler.class)
    private List<String> examples;

    // 近义词列表，json 类型
    @TableField(value = "synonyms", typeHandler = JsonArrayTypeHandler.class)
    private List<String> synonyms;

    // 反义词列表，json 类型
    @TableField(value = "antonyms", typeHandler = JsonArrayTypeHandler.class)
    private List<String> antonyms;

    // 易混淆词分析，json 类型
    @TableField(value = "confusing_word_analysis", typeHandler = JsonArrayTypeHandler.class)
    private List<ConfusingWordAnalysis> confusingWordAnalysis;

    // 创建时间
    @TableField("create_time")
    private LocalDateTime createTime;

    // 更新时间
    @TableField("update_time")
    private LocalDateTime updateTime;

    // 是否共享(1:是;0:否)
    @TableField("is_public")
    private Integer isPublic;

    // 是否删除
    @TableField("is_delete")
    @TableLogic
    private Integer isDelete;

    // 上次复习时间
    @TableField("last_review_time")
    private String lastReviewTime;

    // 下次复习时间
    @TableField("next_review_time")
    private String nextReviewTime;

    // 复习间隔
    @TableField("review_interval")
    private Integer reviewInterval;

    // 记住次数
    @TableField("remember_count")
    private Integer rememberCount;

    // 模糊次数
    @TableField("fuzzy_count")
    private Integer fuzzyCount;

    // 忘记次数
    @TableField("forget_count")
    private Integer forgetCount;

    // 正确次数
    @TableField("correct_count")
    private Integer correctCount;

    // 错误次数
    @TableField("incorrect_count")
    private Integer incorrectCount;

    //卡片状态：NEW=0,  REVIEW=1, MASTERED=2, AWAIT=3
    @TableField("card_status")
    private Integer cardStatus;

    // 是否标记
    @TableField("is_flagged")
    private Integer isFlagged;
}